<%= error_messages_for 'user' %>

<!--[form:user]-->
<p><label for="user_name">Name</label><br/>
<%= text_field 'user', 'name'  %></p>

<p><label for="user_password">Password</label><br/>
<%= password_field 'user', 'password'  %></p>

<p><label for="user_password_confirmation">Password Confirmation</label><br/>
<%= password_field 'user', 'password_confirmation'  %></p>

<p><label for="user_description">Description</label><br/>
<%= text_area 'user', 'description', :rows => 3, :cols => 60  %></p>

<p>
<label>Projects</label><br/>
<ul>
<% @projects.each do | project | %>
  <% user_role = @user.user_roles.find_by_project_id(project.id) %>
  <li>
  <input type="checkbox" name="user_roles[<%= project.id %>]" value="1" <%= (user_role) ? 'checked' : '' %>>
  <input type="hidden" name="user_roles[<%= project.id %>]" value="0">
  <%= project.name %>
  </li>
<% end %>
</ul>
</p>

<!--[eoform:user]-->

